How To Perform Spatial Queries On A Database